package com.example;

/**
 * Hello world!
 *
 */
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.SWT;

public class App {
    public static void main(String[] args) {
        Display display = new Display();          // 操作系统级“显示器”
        Shell shell = new Shell(display);         // 顶层窗口
        shell.setText("SWT + Maven 示例");
        new Label(shell, SWT.NONE).setText("Hello SWT from Maven!");

        shell.pack();                             // 自适应大小
        shell.open();                             // 显示窗口
        while (!shell.isDisposed()) {             // 消息循环
            if (!display.readAndDispatch()) display.sleep();
        }
        display.dispose();
    }
}